package cn.iocoder.yudao.module.lowcode.enums;

import cn.iocoder.yudao.framework.common.exception.ErrorCode;

/**
 * LowCode 错误码枚举类
 *
 * lowcode 低代码模块，使用 1-009-000-000 段
 */
public interface ErrorCodeConstants {

    // ========== Groovy 脚本管理 1-009-000-000 ==========
    ErrorCode GROOVY_SCRIPT_NOT_EXISTS = new ErrorCode(1_009_000_000, "Groovy脚本不存在");
    ErrorCode GROOVY_SCRIPT_NAME_DUPLICATE = new ErrorCode(1_009_000_001, "Groovy脚本名称已存在");
    ErrorCode GROOVY_SCRIPT_COMPILE_FAILED = new ErrorCode(1_009_000_002, "Groovy脚本编译失败");
    ErrorCode GROOVY_SCRIPT_EXECUTION_FAILED = new ErrorCode(1_009_000_003, "Groovy脚本执行失败");
    ErrorCode GROOVY_SCRIPT_INVALID_SYNTAX = new ErrorCode(1_009_000_004, "Groovy脚本语法错误");
    ErrorCode GROOVY_SCRIPT_TIMEOUT = new ErrorCode(1_009_000_005, "Groovy脚本执行超时");
    ErrorCode GROOVY_SCRIPT_PERMISSION_DENIED = new ErrorCode(1_009_000_006, "无权限执行此脚本");
    ErrorCode GROOVY_SCRIPT_SECURITY_VIOLATION = new ErrorCode(1_009_000_007, "脚本包含不安全的代码");

    // ========== Magic-api 管理 1-009-001-000 ==========
    ErrorCode MAGIC_API_NOT_EXISTS = new ErrorCode(1_009_001_000, "Magic API不存在");
    ErrorCode MAGIC_API_PATH_DUPLICATE = new ErrorCode(1_009_001_001, "API路径已存在");
    ErrorCode MAGIC_API_SCRIPT_INVALID = new ErrorCode(1_009_001_002, "Magic API脚本无效");
    ErrorCode MAGIC_API_GENERATE_FAILED = new ErrorCode(1_009_001_003, "Magic API生成失败");
    ErrorCode MAGIC_API_DELETE_FAILED = new ErrorCode(1_009_001_004, "Magic API删除失败");
    ErrorCode MAGIC_API_TABLE_CONFIG_INVALID = new ErrorCode(1_009_001_005, "表配置无效，无法生成API");

    // ========== 数据源配置管理 1-009-002-000 ==========
    ErrorCode DATASOURCE_CONFIG_NOT_EXISTS = new ErrorCode(1_009_002_000, "数据源配置不存在");
    ErrorCode DATASOURCE_CONFIG_NAME_DUPLICATE = new ErrorCode(1_009_002_001, "数据源名称已存在");
    ErrorCode DATASOURCE_CONFIG_CONNECTION_FAILED = new ErrorCode(1_009_002_002, "数据源连接失败");
    ErrorCode DATASOURCE_CONFIG_INVALID_CONFIG = new ErrorCode(1_009_002_003, "数据源配置无效");
    ErrorCode DATASOURCE_CONFIG_IN_USE = new ErrorCode(1_009_002_004, "数据源正在使用中，无法删除");
    ErrorCode DATASOURCE_CONFIG_TEST_FAILED = new ErrorCode(1_009_002_005, "数据源连接测试失败");

    // ========== 通用表格管理 1-009-003-000 ==========
    ErrorCode GENERIC_TABLE_NOT_EXISTS = new ErrorCode(1_009_003_000, "表不存在");
    ErrorCode GENERIC_TABLE_INVALID_NAME = new ErrorCode(1_009_003_001, "表名无效");
    ErrorCode GENERIC_TABLE_RECORD_NOT_EXISTS = new ErrorCode(1_009_003_002, "记录不存在");
    ErrorCode GENERIC_TABLE_FIELD_REQUIRED = new ErrorCode(1_009_003_003, "必填字段不能为空");
    ErrorCode GENERIC_TABLE_FIELD_INVALID = new ErrorCode(1_009_003_004, "字段值无效");
    ErrorCode GENERIC_TABLE_SQL_ERROR = new ErrorCode(1_009_003_005, "SQL执行错误");
    ErrorCode GENERIC_TABLE_OPERATION_DENIED = new ErrorCode(1_009_003_006, "操作被拒绝");
    ErrorCode GENERIC_TABLE_DATA_CONVERSION_ERROR = new ErrorCode(1_009_003_007, "数据类型转换错误");
    ErrorCode GENERIC_TABLE_BATCH_OPERATION_FAILED = new ErrorCode(1_009_003_008, "批量操作失败");
    ErrorCode GENERIC_TABLE_EXPORT_FAILED = new ErrorCode(1_009_003_009, "导出失败");
    ErrorCode GENERIC_TABLE_CONFIG_NOT_FOUND = new ErrorCode(1_009_003_010, "表配置不存在");

}